import { AudioOutlined } from '@ant-design/icons';
import { Input } from 'antd';
import React, { useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import '../index.css'
import { useTranslation } from 'react-i18next';
type Props = {}

const { Search } = Input;

const Serch = (props: Props) => {
    const navigate = useNavigate()
    const { t, i18n } = useTranslation();
    const onSearch = (value: string) => console.log(value);
    useEffect(() => {
        document.addEventListener('keydown', function (e) {
            if (e.keyCode == 27) {
                navigate("/home/article/index")
            }
        });
    }, [])
    return (
        <div className='wrap'>
            <div className='serch_content'>
                <div className="serch_content_son">
                    <div className='serch_top'>
                        <p className='serch_title'>文章搜索</p>
                        <p className='serch_down' onClick={() => {
                            navigate(-1)
                        }}>
                            <span className='serch_close'>x</span>
                            <span className='serch_esc'>esc</span>
                        </p>
                    </div>
                    <Search className='serch_input' placeholder="input search text" onSearch={onSearch} />
                </div>
            </div>
        </div>
    )
}

export default Serch